﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace bookshop
{
    public partial class Splash : Form
    {
        public Splash()
        {
            InitializeComponent();
            timer1.Start();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        int startpos = 0;   
        private void timer1_Tick(object sender, EventArgs e)
        {
            Random random = new Random();
            startpos += random.Next(1,6);

            if (startpos > 100)
            {
                startpos = 100;
            }

            Myprogress.Value = startpos;
            PercentageLbl.Text = startpos + "%";    
            if (Myprogress.Value == 100)
            {
                Myprogress.Value = 0;
                timer1.Stop();
                login login = new login();
                login.Show();
                this.Hide();
            }
        }
    }
}
